package com.gitee.wsl.compose.chart.pie.label

/**
 * Specifies the strategy for placing Pie chart labels.
 */
 sealed interface PieLabelPlacement {
    /**
     * Specify that all pie chart labels should be placed around the outside of the pie (i.e., not within the
     * individual slices).
     */
     data object External : PieLabelPlacement

    /**
     * Specify that all pie chart labels should be placed within the individual pie slices. If the label does not
     * fit, it will not be shown.
     *
     * @param radius Radial position of the label Composable relative to the slice outer radius, between 0 and 1
     */
     data class Internal(val radius: Float = 0.7f) : PieLabelPlacement {
        init {
            require(radius > 0f && radius < 1f) { "radius must be between 0 and 1" }
        }
    }

    /**
     * Specify that pie chart labels should be placed within the individual pie slices if they fit, and if not,
     * then placed externally to the pie.
     *
     * @param radius Radial position of the label Composable relative to the slice outer radius, between 0 and 1
     */
     data class InternalOrExternal(val radius: Float = 0.7f) : PieLabelPlacement {
        init {
            require(radius > 0f && radius < 1f) { "radius must be between 0 and 1" }
        }
    }
}